#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include <signal.h> 
#include <stdlib.h>       
#include <string.h>
#include <pthread.h>
//#include <sys/sem.h>
#include <errno.h>
#include <sys/ipc.h>
//#include <sys/msg.h>
#include <sys/timeb.h>
#include <sys/socket.h>
//#include <sys/socketvar.h>
#include <sys/select.h>
#include <sys/stat.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <semaphore.h>
#include <string.h>
#include <termios.h>
#include <linux/input.h>
#include <semaphore.h>
#include <linux/shm.h>
#include <asm/unistd.h>
#include <sys/poll.h>

#include "common.h"

static int sock = -1;
static struct sockaddr_in addr;	
      
void remotePlayAudioServer(struct recvData *recvData)
{
   	if( sock == -1 )
   	{
		   	sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);		
				addr.sin_family     = AF_INET;
				addr.sin_addr.s_addr = inet_addr( "127.0.0.1" );
				addr.sin_port       = htons( 9600 );
		}
		
		if( sock == -1 ) return;
		
		socklen_t svrlen = sizeof(struct sockaddr_in);
		sendto(sock,recvData->buf,recvData->count,0,(const sockaddr*)&addr,svrlen);
}

